import request from '@/utils/request'

// 查询列表
export function listSequence(query) {
  return request({ url: '/nongjt/printSequence/list', method: 'get', params: query })
}
// 查询详情
export function getSequence(id) {
  return request({ url: `/nongjt/printSequence/${id}`, method: 'get' })
}
// 新增
export function addSequence(data) {
  return request({ url: '/nongjt/printSequence', method: 'post', data })
}
// 修改
export function updateSequence(data) {
  return request({ url: '/nongjt/printSequence', method: 'put', data })
}
// 删除
export function delSequence(id) {
  return request({ url: `/nongjt/printSequence/${id}`, method: 'delete' })
}
// 导出
export function exportSequence(query) {
  return request({
    url: '/nongjt/printSequence/export',
    method: 'get',
    params: query,
    responseType: 'blob', 
    timeout: 60000
  });
}

// 导入
export function importSequence(data) {
  return request({
    url: '/nongjt/printSequence/import',
    method: 'post',
    data,
    headers: { 'Content-Type': 'multipart/form-data' }
  })
}

// 序列号唯一性校验
export function checkSerialUnique(serialNumber) {
  return request({
    url: '/nongjt/printSequence/checkSerialUnique',
    method: 'get',
    params: { serialNumber }
  })
}
